package com.xuxiao.controller;

import com.xuxiao.common.Result;
import com.xuxiao.entrty.UserInfo;
import com.xuxiao.service.UserInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class RegisterController {
    @Autowired
    private UserInfoService userInfoService;

    @PostMapping("/user")
    public Result Register(@RequestBody UserInfo userInfo) {
        userInfoService.Register(userInfo);
        log.info("注册用户：{}", userInfo);
        return Result.success("注册成功");
    }
}
